//
//  新闻仓库
//  SwiftUI+MVVM+Repository
//
//  Created by 高强 on 2024/9/24.
//


import Moya
import Combine

class NewsRepository {
    private let apiService: APIService
    
    init(apiService: APIService = APIService()) {
        self.apiService = apiService
    }
    
    // 获取新闻列表
    func newsList(pageNum: Int, pageSize: Int, type: String) -> AnyPublisher<RowsBean, Error> {
        return apiService.request(NewsAPI.newsList(pageNum: pageNum, pageSize: pageSize, type: type), type: RowsBean.self)
    }

}


